<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<style type="text/css">
		.div1 {
			width: 100px;
			height: 100px;
			background: red;
			margin-top: 20px;
		}
		button {
			padding: 10px 25px;
			border: none;
			background-color: green;
			color: #fff;
			border-radius: 5px;
		}
		</style>
		<div id="app">
			<!-- v-on:可以简写成@ -->
			<button v-on:click='fn'>toggle</button>
			<div class="div1" v-show="bol"></div>
		</div>
		<script src="../vue.min.js"></script>
		<script type="text/javascript">
			var vm = new Vue({
				el: "#app",
				data: {
					bol: false
				},
				methods: {
					fn: function(){
						this.bol = !this.bol;
					}
				}
			})
		</script>
	</body>
</html>
